import 'package:json_annotation/json_annotation.dart';
import 'package:flutter_app/model/addressInfo.dart';
import 'package:flutter_app/model/cmndInfo.dart';
import 'package:flutter_app/model/contactInfo.dart';
import 'package:flutter_app/model/employmentInfo.dart';
import 'package:flutter_app/model/paymentInfo.dart';
import 'package:flutter_app/model/personalInfo.dart';
import 'package:flutter_app/model/photoPaths.dart';

part 'user.g.dart';

@JsonSerializable()
class User {
  User(
    this.messageCount,
    this.idNumber,
    this.addressInfo,
    this.cmndInfo,
    this.contactInfo,
    this.employmentInfo,
    this.paymentInfo,
    this.personalInfo,
    this.photoPaths,
    this.secondaryContactInfo,
  );
  int messageCount;
  String idNumber;
  String mobileNumber = "Atome credit";
  AddressInfo addressInfo;
  CmndInfo cmndInfo;
  ContactInfo contactInfo;
  EmploymentInfo employmentInfo;
  PaymentInfo paymentInfo;
  PersonalInfo personalInfo;
  PhotoPaths photoPaths;
  ContactInfo secondaryContactInfo;

  factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
  Map<String, dynamic> toJson() => _$UserToJson(this);

  // 命名构造函数
  User.empty();
}
